package com.xk857.service.impl;

import com.xk857.db.CarPartDB;
import com.xk857.pojo.CarPart;
import com.xk857.service.CarPartService;
import org.springframework.stereotype.Service;

/**
 * 停车场的业务实现层
 *
 * @author sheepl
 * @Date 2020/1/22
 */
@Service
public class CarPartServiceImpl implements CarPartService {
    @Override
    public boolean setParkRate(String rateType, int money) {
        if (!"count".equalsIgnoreCase(rateType)) {
            return false;
        }
        return true;
    }

    @Override
    public CarPart getParkRate(String rateType) {
        if ("count".equalsIgnoreCase(rateType)) {
            return CarPartDB.carPart;
        }
        return null;
    }

    @Override
    public int getParkFree() {
        return CarPartDB.carPart.getParkFreeId();
    }
}
